A command terminal, also known as a “shell,” is an environment in which a user may instruct a computer system to perform various operations using one or more textual commands. Typically, commands and their argument are formatted in terms one or more white-space delimited words or tokens. Or, a command itself may be structured as a multiple-word sequence.
Command terminals may be difficult to implement for a number of reasons. For example, if the command terminal is to be used to execute a large number of different commands, each of which may accept a variety of different potential arguments, it may be difficult to store all potential command-argument combinations in memory efficiently. It may also be difficult to efficiently match multi-word commands received from users to the specific programs or subroutines associated with such commands.
For example, an input string could be matched to a specific program by comparing the input string to a list of recognized command strings using “if-else” branch statements or a “switch” condition. However, if the total number of command-argument combinations is significant, such code could easily become unwieldy, difficult to maintain, and especially difficult for a third party to extend or modify.
Command terminals may present difficulties from the user side as well. For example, it may be difficult for users to remember specific commands for performing desired actions, especially if the commands include multiple arguments or if the commands are represented by shorter abbreviations that are capable of confusion with similar abbreviations. Users may also become frustrated due to the inflexibility of command terminals. Typically, command terminals are coded so as to perform actions only in response to a user providing an exact match to a command and/or command-argument combination. Thus, even a simple mistake or informality in an entered command may cause the terminal to return an error or to execute the wrong command, adding to user frustration.
Accordingly, command terminals may be improved by techniques that provide for efficient storage and retrieval of programs associated with specific commands and that further provide flexibility to users in entering commands.